package group2assignone.ucm.customer;

import group2assignone.dao.ClientComms;
import group2assignone.model.Customer;
import group2assignone.ucm.UCController;
import group2assignone.ucm.UCStartup;
import group2assignone.view.ClientListView;
import group2assignone.view.OurView;
import group2assignone.view.customer.EditCustomerView;
import java.util.ArrayList;

/**
 * Use Case: Change UI to Customer Edit View 
 * Pre-condition: Customer is logged in and clicks the 'edit account' button. 
 * Post-condition: Customer edit view is displayed.
 * 1. system creates the new Customer edit view
 * 2. system opens the new Customer edit view
 * 3. system exits the current view
 * @author group2
 */
public class UCChangeUIEditCustomer implements UCController {

    private OurView view;
    private Customer customer;

    /**
     * assigns view and customer
     * @param view
     * @param customer
     */
    public UCChangeUIEditCustomer(OurView view, Customer customer) {
        this.view = view;
        this.customer = customer;
    }

    /**
     * Use Case to show the 'Customer Edit' view
     */
    public void run() {
        //1. system creates the new Customer edit view
        EditCustomerView gui = new EditCustomerView(customer);
        gui.go();       //2. system opens the new Customer edit view
        view.dispose(); //3. system exits the current view
    }
}
